package com.ruoyi.system.mapper;

import java.util.Date;
import java.util.List;
import java.util.Map;

import com.ruoyi.system.domain.DevelopmentTop;
import org.apache.ibatis.annotations.Param;

/**
 * 发展量排名Mapper接口
 * 
 * @author ruoyi
 * @date 2025-08-05
 */
public interface DevelopmentTopMapper 
{
    /**
     * 查询发展量排名
     * 
     * @param id 发展量排名主键
     * @return 发展量排名
     */
    public DevelopmentTop selectDevelopmentTopById(Long id);

    /**
     * 查询发展量排名列表
     * 
     * @param developmentTop 发展量排名
     * @return 发展量排名集合
     */
    public List<DevelopmentTop> selectDevelopmentTopList(DevelopmentTop developmentTop);

    /**
     * 新增发展量排名
     * 
     * @param developmentTop 发展量排名
     * @return 结果
     */
    public int insertDevelopmentTop(DevelopmentTop developmentTop);

    /**
     * 修改发展量排名
     * 
     * @param developmentTop 发展量排名
     * @return 结果
     */
    public int updateDevelopmentTop(DevelopmentTop developmentTop);

    /**
     * 删除发展量排名
     * 
     * @param id 发展量排名主键
     * @return 结果
     */
    public int deleteDevelopmentTopById(Long id);

    /**
     * 批量删除发展量排名
     * 
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteDevelopmentTopByIds(Long[] ids);

    public DevelopmentTop selectDevelopmentTopByNameAndDept(@Param("salesman") String salesman,@Param("deptName") String deptName,@Param("activityTime") Date activityTime);

    public List<DevelopmentTop> selectDevelopmentTopListOrder(Long deptId);
    public List<DevelopmentTop> selectDevelopmentTopDetail(@Param("deptId")Long deptId,@Param("targetTime")String targetTime);

    public List<Map<String, Object>> selectDevelopmentTop(@Param("deptId")Long deptId,@Param("targetTime")String targetTime);
    public List<Map<String, Object>> selectCommunitytotal(Long deptId);

    /**
     * 根据部门ID列表查询发展量排名明细
     */
    java.util.List<DevelopmentTop> selectByDeptIds(@org.apache.ibatis.annotations.Param("deptIds") java.util.List<Long> deptIds);
    
    /**
     * 根据部门ID列表和目标时间查询发展量排名明细
     */
    java.util.List<DevelopmentTop> selectByDeptIdsAndTime(@org.apache.ibatis.annotations.Param("deptIds") java.util.List<Long> deptIds, @org.apache.ibatis.annotations.Param("targetTime") Date targetTime);

    /**
     * 根据部门ID和目标时间查询该部门下每个人的套餐具体办理流程
     */
    List<Map<String, Object>> selectSalesmanPackageDetails(@Param("deptId") Long deptId, @Param("targetTime") String targetTime);
}
